package com.gpj.learn.simple.jvm.oom;

import java.util.ArrayList;
import java.util.List;

/**
 * @className HeapOOM
 * @description
 *   模拟堆区OutOfMemory
 *   启动参数如下:
 *     -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=E:\DataRepository\TmpRepository
 * @author GPJ
 * @date 2021/7/24 21:37
 * @version 1.0
 **/
public class HeapOOM {
	public static void main(String[] args) throws InterruptedException {
		List<CustomObject> list = new ArrayList<CustomObject>();

		while (true){
			list.add(new CustomObject());
		}
	}

	static class CustomObject {

	}
}
